const express = require('express')
const router = express.Router()
const db = require('../../../MySql')


router.post('/repo/delete', async (req, res) => {
    try {
        const { ids } = req.body

        await db.query('delete from el_repo where id in (?)', [ids])
        await db.query('delete from el_exam_repo where repo_id in (?)', [ids])

        return res.json({ "msg": "请求成功！", "code": 0, "success": true })
    } catch (error) {
        console.error('删除失败', error)
        return res.status(500).json({
            msg: "删除失败！",
            code: 1,
            data: null
        })
    }
})

module.exports = router
